<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<script type="text/javascript">
    /**
     * 查看分类详情
     */
    function detailInfo(id){
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/productType/getProductTypeObject.sjson",
            data: {productTypeId:id},
            success: function(result){
                var data = JSON.parse(result.data);
                /**重置详情页中所有html展示信息**/
                resetDetailTable("detailTable");
                /**设置展示信息**/
                $("#d_categoryImage").html("<img id='uploadImg_detail_1' class='uploadImg' onMouseOver='showDetailBigImage(1,3,3,0)'  onMouseOut='showDetailRebackImage(1,1,1)' src='${uploadPath}/"+data.categoryImage+"' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' width='50px' height='50px' />");
                $("#d_categoryImageWx").html("<img id='uploadImg_detail_2' class='uploadImg' onMouseOver='showDetailBigImage(2,3,3,0)'  onMouseOut='showDetailRebackImage(2,1,1)' src='${uploadPath}/"+data.categoryImageWx+"' width='50px' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' height='50px' />");
                $("#d_categoryImageApp").html("<img id='uploadImg_detail_3' class='uploadImg' onMouseOver='showDetailBigImage(3,3,3,0)'  onMouseOut='showDetailRebackImage(3,1,1)' src='${uploadPath}/"+data.categoryImageApp+"' width='50px' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' height='50px' />");
                $("#d_sortName").html(data.sortName);
                $("#d_sortAppName").html(data.sortAppName);
                $("#d_sortCode").html(data.sortCode);
                $("#d_categoryDescription").html(data.categoryDescription);
                if(data.isShow==0){
                    $("#d_isShow").html("<font class='color_002'>未显示</font>");
                }else if(data.isShow==1){
                    $("#d_isShow").html("<font class='color_001'>已显示</font>");
                }
                if(data.isRecommend==0){
                    $("#d_isRecommend").html("<font class='color_002'>未推荐</font>");
                }else if(data.isRecommend==1){
                    $("#d_isRecommend").html("<font class='color_001'>已推荐</font>");
                }
                if(data.isLeaf=="1"){
                    $("#d_isLeaf").html("<font class='color_001'>叶节点</font>");
                }else {
                    $("#d_isLeaf").html("<font class='color_002'>分支节点</font>");
                }
                if(data.levelCode=="1"){
                    $("#d_levelCode").html("<font class='color_001'>一级分类</font>");
                }else if(data.levelCode=="2"){
                    $("#d_levelCode").html("<font class='color_002'>二级分类</font>");
                }else if(data.levelCode=="3"){
                    $("#d_levelCode").html("<font class='color_003'>三级分类</font>");
                }
            }
        });
    }
</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">商品分类详情</h5>
			</div>
			<div class="modal-body">
				<table id="detailTable" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
					<tr>
						<td class="toright_td" width="150px">PC端分类图片:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_categoryImage"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">微信端分类图片:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_categoryImageWx"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">APP端分类图片:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_categoryImageApp"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">PC分类名称:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_sortName"></span></td>
						<td class="toright_td" width="150px">APP分类名称:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_sortAppName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">分类排序:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_sortCode"></span></td>
						<td class="toright_td" width="150px">分类描述:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_categoryDescription"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">是否显示:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_isShow"></span></td>
						<td class="toright_td" width="150px">是否推荐:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_isRecommend"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">节点类型:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_isLeaf"></span></td>
						<td class="toright_td" width="150px">分类级别:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_levelCode"></span></td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>